<template>
  <div>
    <el-collapse-transition>
      <div
        id="FlowEditor-AttributesPanels"
        :class="{
          'FlowEditor-AttributesPanels--withSelections': LeftPanelBool,
          'transition-box': true,
        }"
      >
        <div class="editor-left-panel">
          <div class="left-panel-arrow" @click="switchPanel">
            <i
              :class="[
                LeftPanelBool ? 'el-icon-caret-left' : 'el-icon-caret-right',
              ]"
            ></i>
          </div>
        </div>
        <div class="panel" v-show="LeftPanelBool">
          <!-- <AmisRender :schema="schema" :data="data" /> -->
          <!-- 节点面板 -->
          <NodePanel v-if="lf" :lf="lf" :nodeList="nodeList"></NodePanel>
        </div>
      </div>
    </el-collapse-transition>
  </div>
</template>
<script>
// import AmisRender from "../Amis/AmisRender.vue";
import { nodeList } from "../js/config.js";
// import { mapMutations } from "vuex";
import NodePanel from "./NodePanel";
export default {
  name: "LeftPanel",
  components: {
    // AmisRender,
    NodePanel,
  },
  props: {
    lf: Object,
  },
  data() {
    return {
      LeftPanelBool: true,
      nodeList,
    };
  },
  methods: {
    switchPanel() {
      this.LeftPanelBool = !this.LeftPanelBool;
    },
  },
  computed: {
    // panelBool() {
    //   return this.$store.state.panel.rightPanelBool;
    // },
  },
  watch: {},
  mounted() {},
};
</script>
<style  scoped>
#FlowEditor-AttributesPanels {
  height: 100%;
  position: relative;
}
.FlowEditor-AttributesPanels--withSelections {
  /* 修改左侧分类样式 */
  /* width: 70px; */
  width: 250px;
  /* width: 150px; */
}
#FlowEditor-AttributesPanels .panel {
  width: 100%;
  height: 100%;
  overflow: auto;
}

.editor-left-panel .left-panel-arrow {
  position: absolute;
  width: 16px;
  height: 50px;
  top: 50%;
  /* left: -15px; */
  left: 100%;
  transform: translateY(900%);
  background-color: transparent;
  box-sizing: border-box;
  z-index: 10;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.editor-left-panel .left-panel-arrow::before {
  content: "";
  position: absolute;
  border-radius: 10px 0 0 10px;
  box-sizing: border-box;
  border-right: 0;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #ddd;
  z-index: -1;
  transform: perspective(330px) rotateY(150deg);
  transition: all 0.15s;
}
</style>